﻿<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeBehind="RoleUserList.aspx.cs" Inherits="Honestysoft.Baseframework.WebUI.SystemManage.Permission.RoleUserList" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
<script type="text/javascript" src="../../Scripts/jquery-1.6.min.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <link href="../../Styles/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/icon.css" rel="stylesheet" type="text/css" />   
    <link href="../../Styles/control.css" rel="stylesheet" type="text/css" />       
    <script type="text/javascript">
        $(function () {
            $('#treeOrg').tree({
                checkbox: true,
                dnd: false,
                url: '<%=Page.ResolveClientUrl("~/") %>Apply/OrganizationTree.ashx?type=3&RoleID=<%=Request.QueryString["ID"] %>&randID=' + escape(new Date()),
                method: "POST",
                onExpand: function (node) {

                }
//                onLoadSuccess: function (node, data) {
//                    if (data != "") {
//                        var rootNode = $('#treeOrg').tree('getRoot');
//                        $('#treeOrg').tree('collapseAll', rootNode.target);
//                    }

//                }
            });
        });
        function getChecked() {
            var nodes = $('#treeOrg').tree('getChecked');
            var s = '';
            for (var i = 0; i < nodes.length; i++) {
                if (nodes[i].attributes["OuType"] == '<%=((int)Honestysoft.Baseframework.Model.EnumItem.OuType.Employee).ToString() %>') {
                    if (s != '') { s += ',' };
                    s += nodes[i].id;
                }
            }
            document.getElementById('<%=hidChecked.ClientID %>').value = s;
            return true;
        }
	</script>
    <style type="text/css">
        .listbox
        {
            width:200px;height:150px;font-size:9pt;font-family:宋体
        }
    </style>
</head>
<body style="margin-left:14px;margin-top:2px;">
    <form id="form1" runat="server">
    <div id="ajaxcontentarea" class="contentstyle">
        <div class="button_area" style="text-align:left;border-bottom:1px dotted #BABABA;">
            <span style="font-size:12px;font-weight:700;color:blue;padding-bottom:4px">请选择属于角色【<%=Server.UrlDecode(Request["RoleName"])%>】的员工</span>&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button runat="server" ID="btnSave" CssClass="btn_normal" 
			        onMouseOver="this.className='btn_active'" 
                    onMouseOut="this.className='btn_normal'" Text="保 存" 
                OnClientClick="return getChecked();" onclick="btnSave_Click"  />
         </div>

        <ul id="treeOrg" style="padding-top:4px;"></ul>
    </div>
    <asp:HiddenField runat="server" ID="hidChecked" />
    </form>
</body>
</html>